\rcube_csv2vcard

CSV to vCard data converter

Summary

Methods
Properties
Constants
__construct()
import()
set_map()
get_fields()
export()
No public properties found
No constants found
parse_line()
parse_header()
csv_to_vcard()
$csv2vcard_map
$label_map
$gmail_label_map
$local_label_map
$vcards
$map
N/A
No private methods found
No private properties found
N/A

Properties

$csv2vcard_map

$csv2vcard_map : array

CSV to vCard fields mapping

Type

array

$label_map

$label_map : array

CSV label to text mapping for English

Type

array

$gmail_label_map

$gmail_label_map : array

Special fields map for GMail format

Type

array

$local_label_map

$local_label_map : array

Type

array — Localized labels map

$vcards

$vcards : \rcube_vcard[]

Type

rcube_vcard[] — List of contacts as vCards

$map

$map : array

Type

array — Field mapping

Methods

__construct()

__construct(string  $lang = 'en_US') : mixed

Class constructor

Parameters

string $lang

File language

Returns

mixed —

import()

import(string  $csv, bool  $dry_run = false, bool  $skip_head = true) : array

Import contacts from CSV file

Parameters

string $csv

Content of the CSV file

bool $dry_run

Generate automatic field mapping

bool $skip_head

Skip header line

Returns

array —

Field mapping info (dry run only)

set_map()

set_map(mixed  $elements) : mixed

Set field mapping info

Parameters

mixed $elements

Returns

mixed —

get_fields()

get_fields() : array

Set field mapping info

Returns

array —

Array of vcard fields and localized names

export()

export() : array

Export vCards

Returns

array —

rcube_vcard List of vcards

parse_line()

parse_line(string  $line) : array

Parse CSV file line

Parameters

string $line

Line of text from CSV file

Returns

array —

CSV data extracted from the line

parse_header()

parse_header(array  $lines) : mixed

Parse CSV header line, detect fields mapping

Parameters

array $lines

One or two header lines in CSV file

Returns

mixed —

csv_to_vcard()

csv_to_vcard(array  $data) : mixed

Convert CSV data row to vCard

Parameters

array $data

CSV data array

Returns

mixed —